//
//  CommissionHeadCell.m
//  WGFGlobalHouses
//
//  Created by waiguofang on 15/6/8.
//  Copyright (c) 2015年 waiguofang. All rights reserved.
//

#import "CommissionHeadCell.h"


@interface CommissionHeadCell ()
//佣金总金额
@property (weak, nonatomic) IBOutlet UILabel *commissionMoneryCountLab;
//总销售额
@property (weak, nonatomic) IBOutlet UILabel *salesCountLab;
//总销售房源量
@property (weak, nonatomic) IBOutlet UILabel *salesHoursCountLab;
//平均佣金比例了
@property (weak, nonatomic) IBOutlet UILabel *rateLab;
//已结算佣金
@property (weak, nonatomic) IBOutlet UILabel *payedCommissionLab;
//日期
@property (weak, nonatomic) IBOutlet UILabel *dateLab;
@property (weak, nonatomic) IBOutlet UIView *detailView;

@property (nonatomic,strong)NSLayoutConstraint *layout;


@end


@implementation CommissionHeadCell


+(instancetype)creatViewWithTableView:(UITableView *)tableView{

    static NSString *ID = @"CommissionHeadCell";
     CommissionHeadCell *CELL = [tableView dequeueReusableCellWithIdentifier:ID];
    if (CELL == nil)
    {
        CELL = [[[NSBundle mainBundle]loadNibNamed:@"CommissionHeadCell" owner:nil options:nil]lastObject];
        
        [CELL setSelectionStyle:UITableViewCellSelectionStyleNone];
        
    }

    return CELL;
}

+(CGFloat)getHight;
{
    return 251;
}
-(void)setData:(CommissionData*)data{

    [self.commissionMoneryCountLab setText:data.commissionMoneryCount];
    [self.salesCountLab setText:[data.saleMoneryCount stringByReplacingOccurrencesOfString:@"$" withString:@""]];
    [self.salesHoursCountLab setText:[data.saleHourseCount stringByReplacingOccurrencesOfString:@"$" withString:@""]];
    [self.rateLab setText:data.commissionRate];
    [self.payedCommissionLab setText:[data.passCommissionMoneryCount stringByReplacingOccurrencesOfString:@"$" withString:@""]];
    
    NSDate *nowDate = [NSDate date];
    NSDateFormatter *formatt = [[NSDateFormatter alloc]init];
    formatt.dateFormat = @"yyyy-MM-dd";
    self.dateLab.text = [formatt stringFromDate:nowDate];
}
//点击问号
- (IBAction)QuetionBtnOnClick:(id)sender {
    
    if (self.delegate && [self.delegate respondsToSelector:@selector(CommissionHeaderCellQuestionBtnOnClick)]) {
        
        [self.delegate CommissionHeaderCellQuestionBtnOnClick];
    }
}

@end
